package components.utils.observer;

import components.TestsInputTable;
import components.utils.TableColumnAdjuster;
import entity.Sample;
import java.util.ArrayList;
import java.util.Collection;
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.table.TableColumn;

public class TestsInputTableUpdater extends CollectionObserver {
    
    private TableColumnAdjuster tca;
    private TestsInputTable table;

    public TestsInputTableUpdater(Collection collection) {
        super(collection);
    }

    public void setTca(TableColumnAdjuster tca) {
        this.tca = tca;
    }

    public void setTable(TestsInputTable table) {
        this.table = table;
    }

    @Override
    public void notifyObserver() {
        table.setTests(new ArrayList(collection));
        tca.adjustColumns();
    }

}
